package com.example.demo.Service;


import com.example.demo.Entity.Shelf;
import com.example.demo.Entity.Warehouse;

import java.util.List;
import java.util.Optional;

public interface ShelfService {

    // 创建一个新的 Shelf
    Shelf createShelf(Shelf shelf);

    // 通过 ID 获取 Shelf
    Optional<Shelf> getShelfById(Long id);

    // 获取所有的 Shelf
    List<Shelf> getAllShelves();

    // 更新 Shelf
    Shelf updateShelf(Long id, Shelf shelf);

    // 通过 ID 删除 Shelf
    boolean deleteShelf(Long id);

    // 根据仓库查找货架
    List<Shelf> findByWarehouse(Warehouse warehouse);

    // 根据位置查找货架
    List<Shelf> findByLocation(String location);

    // 根据最大承重查找货架
    List<Shelf> findByMaxWeight(Double maxWeight);

    // 根据当前承重查找货架
    List<Shelf> findByCurrentWeight(Double currentWeight);

    // 根据物品重量查找最近货架
    Shelf findByItemInWeight(List<Shelf> shelves, double Weight, double quantity);

    Shelf findByItemOutWeight(List<Shelf> shelves, double Weight, double quantity);

    void saveShelf(Shelf shelf);


}

